package lab02.test05;

/**
 * Created by Administrator on 2017/10/15.
 */
public class Cube {
    //属性：长、宽和高
    private float length;
    private float wide;
    private float high;
    //行为：定义一个方法对这三个变量进行初始化,求立方体的体积
    public Cube(float l,float w,float h){
        this.length=l;
        this.wide=w;
        this.high=h;
    }
    //构造函数:创建一个对象，求给定尺寸的立方体的体积
    public float buiktext(){
        return this.length*this.wide*this.high;
}
    //main函数
    public static void main(String[] args) {
        Cube cube1 = new Cube(7, 8, 9);
        System.out.println("体积是："+cube1.buiktext());
    }
}
